<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
$document = & JFactory::getDocument();
$renderer = $document->loadRenderer('message');
$msg = $renderer->render('');
?>

<div class="col-main">
	<div class="cart row">
		<div class="page-title title-buttons">
			<h1 class="span6">Giỏ Hàng</h1>
			<ul class="checkout-types span6">
				<li>
					<button type="button" title="Proceed to Checkout" class="button btn-proceed-checkout btn-checkout"
							onclick="window.location='<?php echo $this->checkoutLink; ?>';">
						<span><span>Thanh Toán</span></span>
					</button>
				</li>
			</ul>
		</div>
		<form action="<?php echo $this->updateLink; ?>" method="post">
			<fieldset class="span12">
				<table id="shopping-cart-table" class="data-table cart-table">
					<colgroup>
						<col width="1" />
						<col />
						<col width="1" />
                        <col width="1" />
                        <col width="1" />
                        <col width="1" />
                	</colgroup>
                	<thead class="hidden-phone">
                		<tr class="first last">
                			<th rowspan="1">&nbsp;</th>
                			<th rowspan="1"><span class="nobr">Tên sản phẩm</span></th>
                			<th class="a-center" colspan="1"><span class="nobr">Giá</span></th>
                			<th rowspan="1" class="a-center">Số lượng</th>
                			<th class="a-center" colspan="1">Tổng</th>
                			<th rowspan="1" class="a-center">&nbsp;</th>
                		</tr>
                	</thead>
                	<tfoot>
                		<tr class="first last">
                			<td colspan="6" class="a-right last">
                				<button type="button" title="Tiếp tục mua hàng" class="button btn-continue"
                						onclick="window.location='<?php echo $this->continueLink; ?>';">
                					<span><span>Tiếp tục mua hàng</span></span>
                				</button>
                            	<button type="submit" title="Update Shopping Cart" class="button btn-update">
                            		<span><span>Cập nhật giỏ hàng</span></span>
                            	</button>
                            </td>
						</tr>
					</tfoot>
					<tbody>
						<?php foreach ($this->items as $item) { ?>
							<tr class="first last odd">
								<td>
									<a href="<?php echo $item['link']; ?>" title="<?php echo $item['data']->name; ?>" class="product-image">
										<img src="<?php echo $item['thumbnail']; ?>" alt="<?php echo $item['data']->name; ?>" />
									</a>
								</td>
								<td>
									<h2 class="product-name">
										<a href="<?php echo $item['link']; ?>"><?php echo $item['data']->name; ?></a>
	                				</h2>
	                			</td>
	                			<td class="a-right">
	                				<span class="nobr cart-label hidden-desktop hidden-tablet">Giá</span>
	                				<span class="cart-price"><span class="price"><?php echo number_format($item['price'], 0, ',', '.'); ?> đ</span>
                					</span>
	                			</td>
	                			<td class="a-center">
	                				<span class="quantity cart-label hidden-desktop hidden-tablet">Số lượng</span>
	                				<input name="qty_<?php echo $item['id']; ?>" value="<?php echo $item['qty']; ?>" size="4" title="Qty" class="input-text qty" maxlength="12" />
	    						</td>
	        					<td class="a-right">
	        						<span class="subtotal cart-label hidden-desktop hidden-tablet">Tổng</span>
	        						<span class="cart-price"><span class="price"><?php echo number_format($item['total'], 0, ',', '.'); ?> đ</span></span>
	        					</td>
	        					<td class="a-center hidden-phone last">
	        						<a href="<?php echo $item['deleteLink']; ?>" title="Remove item" class="btn-remove btn-remove2">Remove item</a>
	        					</td>
							</tr>
						<?php } ?>
                  	</tbody>
      			</table>
    		</fieldset>
  		</form>
	</div>
	<div class="cart-collaterals row">
		<div class="span4" style="float: right">
			<div class="totals">
				<table id="shopping-cart-totals-table">
					<colgroup>
						<col />
						<col width="1" />
					</colgroup>
					<tr>
						<td style="" class="a-right" colspan="1"><strong>Tổng Cộng</strong></td>
						<td style="" class="a-right">
							<strong>
								<span class="price">
									<?php echo number_format($this->total, 0, ',', '.'); ?> đ
								</span>
							</strong>
						</td>
					</tr>
				</table>
				<ul class="checkout-types a-right">
        			<li>
        				<button type="button" title="Đặt hàng" class="button btn-proceed-checkout btn-checkout"
        						onclick="window.location='<?php echo $this->checkoutLink; ?>';">
        					<span>Đặt hàng</span>
        				</button>
        			</li>
        		</ul>
        	</div>
        </div>
	</div>
</div>